home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Installer SDK Cornucopia 1.0.2 / Script Examples / Install App Fat⁄PPC⁄68K / InstallFatApp.r < prev    next >
Encoding:
Text File  |  1996-09-17  |  43.8 KB  |  1,407 lines  |  [TEXT/MPS ]

  1. //
  2. //    Install Fat App.r
  3. //
  4. //    This install script demonstrates the installation of an application that    
  5. //    can run on a Power Macintosh in Native Mode, a 68000 Macintosh, or both.
  6. //
  7. //    The ability for an application to run under either a PowerMac or 68K machine
  8. //    is referred to as a Fat Application. This decidely untechnical term refers
  9. //    simply to the fact that the application contains more resources than are
  10. //    needed to run on one platform or the other, and is larger than a version
  11. //    of the same application that runs on only a single platform. 
  12. //
  13. //    The main purpose of this installer script is to allow for installation
  14. //    of a Fat Application, or alternatively either the 68K only version, or
  15. //    the PowerMac only version.
  16. //
  17. //    This is easy to accomplish through Easy Install, as the scriptwriter
  18. //    has complete control over what is going to be installed.
  19. //
  20. //    What is not easy to accomplish is the creation of one package in Custom
  21. //    Install, that will install the Fat Application, but has two sub-packages
  22. //    that will install either the 68K only version or the PowerMac only version
  23. //    if selected individually, but install the Fat Application if they are
  24. //    both selected.
  25. //
  26. //    The above described Custom Install scenario has been requested by
  27. //    scriptwriters within Apple and by 3rd party developers as something
  28. //    they would like to be able to do. The specific needs of your project
  29. //    may differ. If the demands of the Custom Install scenario described do
  30. //    not apply to your situation, then your install script may end up being
  31. //    a lot simpler than this example.
  32. //
  33. //    NOTE: The previous version of this example script included three changes from
  34. //  the original.
  35. //  1) Installation of the PowerMac data fork via InstaCompOne file compression.
  36. //  (This necessitated splitting the PowerMac data fork and resource into seperate
  37. //  source files.  However, the following instructions did not note that change.
  38. //  The instructions have now been corrected. We apologize for any confusion the
  39. //  incorrect instructions may have caused.)
  40. //  2) Installation of 68K CODE resource items via InstaCompOne resource compression.
  41. //  3) A 'vers' resource item was added to the resource fork of the archive containing
  42. //    the data fork for the PowerMac.
  43. //
  44. //    For simplicity of scripting, all files and resource items that can be
  45. //    installed have been grouped into four categories:
  46. //        1) PowerMac specific resources
  47. //        2) PowerMac data fork
  48. //        3) 68K specific stuff
  49. //        4) Common stuff ( used by either 68K or PowerMac )
  50. //        5) PowerMac Warning on 68K ( used by the PowerMac only version )
  51. //
  52. //    From the applications 'ModApp.Fat' (which can be found in the folder
  53. //  'Source Files:') and 'NotPPC' ( which can be found inside the folder
  54. //  'NotPPC:' ) five files have been created, each file
  55. //     containing the items for one of the above described categories. These
  56. //    five files will be used as the sources for installation.
  57. //
  58. //    To create the five files described above:
  59. //        1) Start with a complete Fat Application
  60. //        2) Remove all CODE resources from the Fat Application
  61. //                and put them in a new ResEdit file
  62. //        3) Save this ResEdit file as "68K Macintosh Part"
  63. //        4) Continue using the modified Fat Application
  64. //        5) Remove all remaining resources, except for the 'cfrg' item
  65. //                and put them in a new ResEdit file
  66. //        6) Save this ResEdit file as "Common Part"
  67. //        7) Save the 'cfrg' into a new ResEdit file called "PowMac Rsrc Fork"
  68. //        7) Rename the modified Fat Application as "PowMac Data Fork"
  69. //        8) Copy all the resources from "NotPPC" application
  70. //           into a new ResEdit file.
  71. //        9) Save this ResEdit file  as "PowerMacWarnOn68K Part"
  72. //    
  73. //
  74. //    When installing one of the three basic scenarios ( PowerMac, 68K, Fat App ) 
  75. //    install the following groups for each:
  76. //        1) 68K         <= 68K specific stuff, Common stuff
  77. //        2) PowerMac <= PowerMac Data Fork, PowerMac Rsrc Fork, Common stuff, PowMac Warn on 68K
  78. //        3) Fat App     <= PowerMac Data Fork, PowerMac Rsrc Fork, 68K specific stuff, Common stuff
  79. //
  80. //    NOTE: Because of Custom Install design specs ( described earlier ), we have
  81. //    to be a little tricky when designing the PowerMac package to be added to
  82. //    Custom Install. It is necessary to include the "PowerMac Warn on 68K" module 
  83. //     in the PowerMac portion. But we don't know when the PowerMac portion is 
  84. //    selected from Custom Install whether it is part of a complete Fat App 
  85. //    installation or part of a PowerMac only installation.
  86. //
  87. //
  88. //    Contents of each installation source file :
  89. //
  90. //        68K Macintosh Part         
  91. //                -    'CODE' (0) resource item         // CODE for 68K app
  92. //                -    'CODE' (1) resource item         // CODE for 68K app
  93. //                -    'CODE' (2) resource item         // CODE for 68K app
  94. //
  95. //        PowMac Data Fork
  96. //                -     data fork                        // CODE for PowerMac app
  97. //
  98. //        PowMac Rsrc Fork
  99. //                -    'cfrg' (0) resource item        // describes data fork contents
  100. //
  101. //        Common Part                
  102. //                - This file contains all the resources in the Fat App
  103. //                except for the actual CODE to run the program on either
  104. //                platform ( 68K or PowerMac ), and except for the 'cfrg'
  105. //                resource item from the PowerMac portion.
  106. //                                
  107. //        PowerMacWarnOn68K Part
  108. //                -    'CODE' (0) resource item        // 68K CODE for NotPPC alert
  109. //                -    'CODE' (1) resource item        // 68K CODE for NotPPC alert
  110. //                -    'ALRT' (27309) resource item    // rsrc's for NotPPC alert
  111. //                -    'DITL' (27309) resource item    // rsrc's for NotPPC alert
  112. //                -    'STR ' (27309) resource item    // rsrc's for NotPPC alert
  113. //
  114. //    NOTE: In the PowerMac application, the CODE for the program is stored
  115. //        in the DATA fork of the application. In the 68K application, the 
  116. //        CODE for the program is stored in resource items of type 'CODE'.
  117. //        Because the PowerMac CODE is stored in the data fork, we must use 
  118. //        a file atom ( 'infa' ) to handle installation of the CODE to run 
  119. //        the program. Because the 68K CODE is stored in resources, 
  120. //        we can use resource atoms ( 'inra' ) to handle installation.
  121. //
  122. //
  123. //    IMPORTANT: The 68K specific portion of the installation consists entirely
  124. //    of five 'CODE' type resource items, numbered 0 to 4. The "PowerMac Warning
  125. //    on 68K" portion of the installation contains among other things two 'CODE' 
  126. //    type resource items, numbered 0 to 1 ( the same CODE resources that
  127. //    were created as the "NotPPC" code resource ). The sole purpose of the two 
  128. //    'CODE' resource items within "PowerMac Warning on 68K" portion is to provide 
  129. //    an alert when the PowerMac only version of the application is launched on 
  130. //    a 68K system. This alert explains to the user that there's not much of a 
  131. //    chance that the application can run successfully on a 68K system. Special 
  132. //    care needs to be exercized so that the 68K specific 'CODE' resource items 
  133. //    are NEVER replaced by any of the PowerMac specific 'CODE' resource items. 
  134. //
  135. //    Now for the really interesting part. Because of the design spec for Custom
  136. //    Install ( described earlier ), we must take different approaches to the
  137. //    Custom Installation packages depending on whether or not the target 
  138. //    application already exists. Remember that we need to be careful when
  139. //    installing "PowerMac Warning on 68K" CODE resource items, that these
  140. //    resource items never overwrite the 68K CODE resource items.
  141. //
  142. //    If the target application already exists we must use resource atoms 
  143. //    ( 'inra' ) to install the "PowerMac Warning on 68K" CODE resources. 
  144. //    The "keepExisting" flag provided with the resource atom ( 'inra' ) 
  145. //    allows us to prevent resource items from replacing any existing resource 
  146. //    items of the same resource type and resource ID. This will prevent the 
  147. //    "PowerMac Warning on 68K" resource items from replacing 68K code resources.
  148. //
  149. //    If the target application does not already exist we must use 
  150. //    ResMerge ( 'inrm' ) atoms to install the "PowerMac Warning on 68K" 
  151. //    CODE resources. The installer checks before installation to see whether 
  152. //    or not resource items being installed will be replacing existing resources. 
  153. //    If resource items are installed after installation begins, even though we 
  154. //    have told the installer to "keepExisting" resource items, it will overwrite  
  155. //    them if the resource items did not exist before installation began. Using a 
  156. //    ResMerge ( 'inrm' ) atom to handle installation of "PowerMac Warning on 68K"
  157. //    CODE resources will force the "PowerMac Warning on 68K" resource items
  158. //    to be installed before the 68K CODE resources. This is because the
  159. //    68K CODE resource items are installed via resource atoms ( 'inra' ) , 
  160. //    and in this case the "PowerMac Warning on 68K" CODE resource items are 
  161. //    being installed using ResMerge ( 'inrm' ) atoms. ResMerge atoms are always 
  162. //    processed before resource atoms. 
  163. //
  164. //
  165. //    IMPORTANT: It is necessary to place the "PowerMacWarnOn68K Part"
  166. //    file on the first installation disk so that it is assured that
  167. //    the "PowerMac Warn on 68K" portion is processed before the "68K" portion.
  168. //    This is only necessary for the case where the target application does not
  169. //    already exist, but we have no way of knowing whether this condition will
  170. //    exist or not at the time that the installation script is written.
  171. //
  172. //    Because we must take different approaches ( depending on whether or not
  173. //    the target application already exists ) to installing the PowerMac
  174. //    portion of the application under Custom Install, we must load different
  175. //    packages into the list that the user can select from in Custom Install.
  176. //    Each package provides installation of the Fat Application, with subpackages
  177. //    allowing the user to select either the 68K only version, the PowerMac only
  178. //    version, or both. The difference between the Custom Install packages is
  179. //    whether ResMerge ( 'inrm' ) or resource atoms ( 'inra' ) were used to install 
  180. //    the "PowerMac Warning on 68K" CODE resources.
  181. //
  182. //
  183. //    When installing the PowerMac CODE that is stored in the data fork, it is
  184. //    necessary to use a file atom ( 'infa' ) to copy over the data fork into
  185. //    the target application. Note that the file atom we use specifies that
  186. //    the resource fork will not be replaced in the existing target application,
  187. //     if any, through the setting of the flag 'noRsrcFork'.
  188. //
  189. //
  190. //    When installing the "Common Part", it's okay to always overwrite the existing
  191. //    resource items. This allows us to use the resource merge atom ( 'inrm' ). 
  192. //    Resource merge atoms take all the resource items from the resource fork of
  193. //    the source file and "merge" those resources into the resource fork of a 
  194. //    new or existing target file. Resource merge atoms do not, however, allow
  195. //    specification of flags to control installation. Resource merge atoms 
  196. //    always overwrite resource items that have the same resource type and ID.
  197. //
  198. //
  199. //
  200. //     Layout and description of files contained within this example folder :
  201. //
  202. //    Main folder :
  203. //
  204. //        InstallFatApp.r                - source script ( .r ) for installation
  205. //
  206. //        Makefile                    - MPW script that creates finished install 
  207. //                                        script from the source script ( .r )
  208. //
  209. //        InstallFatApp                - finished installation script
  210. //
  211. //        InstallFatApp w/ Debugger    - finished installation script containing 
  212. //                                      debugger information
  213. //
  214. //        CheckIfInternalRuleFunc        - code resource that is called within
  215. //                                      install script during installation
  216. //                                      to check if selected target volume
  217. //                                      is internal hard disk ( building of
  218. //                                      this code resource is automated
  219. //                                      within the Makefile )
  220. //
  221. //        CheckIfInternalRuleFunc.c     - source file used to create 
  222. //                                      compiled code resource
  223. //
  224. //
  225. //    "Disk 1" folder :                - contains source pieces needed for install
  226. //
  227. //        68KRsrcArchive                - InstaComp archive containing the 68K CODE resources
  228. //
  229. //        Common Part                    - ResEdit file containing resources common to both the
  230. //                                      68K and PowerMac applications.
  231. //
  232. //        Power Macintosh Part        - ResEdit file containing the 'cfrg' (0) resource
  233. //
  234. //        PowerMacWarnOn68K Part        - ResEdit file containing CODE resources for 68K NotPPC alert
  235. //
  236. //        PowMacFileArchive            - InstaComp archive containing the PowerMac application's
  237. //                                      data fork.
  238. //
  239. //
  240. //    "NotPPC" Folder :
  241. //
  242. //        NotPPC                    - module containing the two 'CODE' resource
  243. //                                  items that will provide an alert when the
  244. //                                  PowerMac only version is launched on 68K.
  245. //
  246. //        NotPPC ReadMe            - explains the NotPPC files and functionality
  247. //
  248. //        NotPPC.c                - source for NotPPC module
  249. //
  250. //        NotPPC.h                - defines for NotPPC.c
  251. //    
  252. //        NotPPC.make                - makefile for NotPPC module
  253. //
  254. //        NotPPC.r                - resource definitions for NotPPC module
  255. //
  256. //
  257. //    NOTE on NotPPC    - this module is not automatically created by the makefile
  258. //    that generates the finished installer script. The main reason for this is
  259. //    that the NotPPC module is a standardized method for dealing with the situation
  260. //    where the user attempts to launch a PowerMac application on the 68K platform.
  261. //    Scriptwriters should not need to make any changes to this module. If you wish
  262. //    to make any changes, simply set the current directory for MPW to ':NotPPC:'
  263. //    and run the makefile to build a new version of 'NotPPC' code resource. 
  264. //    Be sure to copy the two 'CODE' resources (0) and (1) into the file
  265. //    'PowerMacWarnOn68K Part' in the 'Source Files' folder.
  266. //    
  267. //    "Source Files" Folder :
  268. //
  269. //        68K Macintosh Part            - 68K specific portion of application
  270. //
  271. //        Common Part                    - portion necessary for either machine type
  272. //
  273. //        ModApp.fat                    - application that supports either 68K or
  274. //                                      PowerMac Native Mode. This file is not
  275. //                                      included in the installation, but is used
  276. //                                      as the source for four of the other files 
  277. //                                       listed in "Source Files". The various 68K
  278. //                                      specific parts are cut and copied into 
  279. //                                      '68K Macintosh Part', the PowerMac specific
  280. //                                      stuff is cut and copied into 'PowMac Data Fork', 
  281. //                                      and 'PowMac Rsrc Fork', and everything remaining 
  282. //                                      is copied into'Common Part'. In addition the 
  283. //                                      two resource items 'CODE' (0) and (1)  from 
  284. //                                      'NotPPC' are copied into 'PowerMacWarnOn68K Part'.
  285. //
  286. //        PowerMacWarnOn68K Part        - ResEdit file containing CODE resources for 68K NotPPC alert
  287. //
  288. //        PowMac Data Fork            - PowerMac application's data fork
  289. //
  290. //        PowMac Rsrc Fork            - PowerMac application's 'cfrg' (0) resource
  291. //
  292. //
  293. //    NOTE on "Source Files" - these files are not automatically created by the
  294. //    makefile for 'Install Fat App'. The scriptwriter should prepare similiar
  295. //    modules for their project by taking a finished copy of a Fat Application
  296. //    and copying and pasting the correct resource items into the three files.
  297. //
  298. //
  299. //    Other Considerations:
  300. //
  301. //    - it is simpler to split the 68K and PowerMac CODE resources into two
  302. //    different source files, because these CODE resources occupy the same
  303. //    resource type and ID in the installed application.
  304. //
  305. //    - often times a Fat Application cannot fit onto a single installation
  306. //    disk, and splitting the Fat Application into it's "logical" pieces
  307. //    is a convenient way to split the file
  308. //
  309. //    - splitting the Fat Application allows us to create a simpler method
  310. //    for creating a variety of target applications, such as 68K only,
  311. //    PowerMac only, and a full Fat Application version.
  312. //
  313. //    - splitting the Fat Application also allows us to use less space on the
  314. //    installation disks, then would be taken if we included three full and distinct
  315. //    versions on the installation disks.
  316. //
  317. //        Copyright 1993-1996, Apple Computer, Inc., All Rights Reserved
  318. //
  319.  
  320. /************************** 
  321.  
  322.  
  323. // Easy Install Package List:
  324.  
  325.     • pick the first applicable case
  326.     
  327.     Target already exists as Fat Application:
  328.         - install Full Fat Application ( update )
  329.     
  330.     Target already exists as 68K version on PowerMac:
  331.         - install Full Fat Application ( update )
  332.     
  333.     Target already exists as PowerMac version on 68K:
  334.         - install Full Fat Application ( update )
  335.     
  336.     Target already exists, and target volume is an external drive:
  337.         - install Full Fat Application ( update )
  338.     
  339.     Target volume is an external drive:
  340.         - install Full Fat Application ( install )
  341.     
  342.     Target machine is a 68K:
  343.         - install 68K Application
  344.     
  345.     Target machine is a PowerMac:
  346.         - install PowerMac Application ( update )
  347.     
  348.     Otherwise:
  349.         - display error that "machine must be 68K or PowerMac"
  350.     
  351.     NOTE: This last case ( Otherwise ) is actually not needed since
  352.     the only time it would be evoked is when the machine being installed
  353.     to is not a 68K or PowerMac. But if the user managed to get the installer
  354.     application to launch on a TRS-80, the user would get a cool error message.
  355.     
  356.  
  357. // Custom Install Package List:
  358.  
  359.     • pick the first applicable case
  360.  
  361.     Target already exists:
  362.  
  363.         - add update full fat app package
  364.  
  365.         // includes the following two subpackages as selectable options
  366.         
  367.         "Demo Application for 68K Macintosh"
  368.         "Demo Application for Power Macintosh" ( update )
  369.  
  370.     Otherwise:
  371.  
  372.         - add install full fat app package
  373.  
  374.         // includes the following two subpackages as selectable options
  375.         
  376.         "Demo Application for 68K Macintosh"
  377.         "Demo Application for Power Macintosh" ( install )
  378.  
  379.  
  380. **********************************/
  381.  
  382.  
  383. include "CheckIfInternalRuleFunc";
  384.  
  385. #include "InstallerTypes.r"
  386.  
  387. // include the InstaCompOne atom extender stuff
  388. // making sure not to add their version resource
  389. // to our installer script
  390. include ":::Tools:Released:InstaCompOne 1.1:InstaCompAtomExt.rsrc" NOT 'vers';
  391.  
  392. #define currentReleaseDate        -1470076096        
  393. #define currentVersion            0x01008000
  394.  
  395.  
  396. /********************* Easy Install Rule resources *****************************/
  397.  
  398.  
  399. // • Rule function code resource ( 'inrf' )
  400.  
  401. // This code resource, which must be referenced from within a call by
  402. // checkRuleFunction{} within a rule clause, returns true if the 
  403. // selected target volume for the installation has a SCSI ID# of 0,
  404. // otherwise it returns false. This, in effect, is a check to see
  405. // if the selected target volume is the internal drive of the machine
  406. // being installed onto.
  407. #define kCheckIfInternalDriveUFID    9000
  408.  
  409.  
  410. // • Values for checkGestalt rule clause
  411.  
  412. #define gestaltSystemType            'sysa'             // processor type
  413. #define gestalt68Ksysa                1                // 68000 designator
  414. #define gestaltPPCsysa                2                // PowerMac designator
  415.  
  416. // • assertions
  417.  
  418. // NOTE: Assertions are simply a technique for eliminating repetitive 
  419. // condition checks, as well as clarifying rule frameworks. Checks
  420. // are made once and assertions are set. Those assertions are checked
  421. // later within rule clauses, which then take action based on the 
  422. // conditions found earlier.
  423.  
  424. // NOTE: Just defining an assertion does not set that assertion. To set an
  425. // assertion you must call AddAssertion{} from within a rule clause.
  426.  
  427. #define kUpdatingTargetFile            701
  428. #define kUpdating68Kpart            702
  429. #define kUpdatingPowerMacPart        703
  430. #define kTgtVolIsInternalDrive        704
  431. #define kTgtVolIsExternalDrive        705
  432. #define kMachineIsPowerPC            706
  433.  
  434. // • constants for packages and atoms
  435.  
  436. #define    kInstallFullFatApp            30000    // used for package
  437. #define    kUpdateFullFatApp            30001    // used for package
  438. #define    kOverWrite68KApp            30002    // used for package
  439. #define    kUpdatePowerMacApp            30003    // used for package
  440. #define    kInstallPowerMacApp            30004    // used for package
  441. #define    kDeleteFullApp                30005    // used for package
  442.  
  443. #define    kCommonStuff                30006    // used for package and atoms
  444. #define    k68KStuff                    30007    // used for package and atoms
  445. #define    kPowerMacStuff                30008    // used for package
  446.  
  447. #define    kInstallPowMacWarnOn68K        30009    // used for package
  448. #define    kUpdatePowMacWarnOn68K        30010    // used for package
  449. #define    kAddPowerMacTo68KApp        30011    // used for package
  450.  
  451. #define    kPowerMacFileAtom            30012    // used for file atom
  452. #define    kPowerMacRsrcAtom            30013    // used for rsrc atom    
  453.  
  454. // • Rule frameworks
  455.  
  456. // • Global framework
  457.  
  458. resource 'infr' (kGlobalFrameworkRsrcID) {
  459.     format0  {{
  460.         // run through all these rule clauses
  461.         pickAll,    { 701, 702, 703, 704, 705, 706 },
  462.     }};
  463. };
  464.  
  465. // if target file exists, set assertion kUpdatingTargetFile
  466. resource 'inrl' (701, "Check if target file already exists") {
  467.     format0 {{
  468.         CheckFileRsrcForkExists { 10000 },
  469.         AddAssertion {{ kUpdatingTargetFile }}
  470.     }};
  471. };
  472.  
  473. // if 68K version exists, set assertion kUpdating68Kpart
  474. resource 'inrl' (702, "Check if 68K version already exists") {
  475.     format0 {{
  476.         CheckAllAssertions {{ kUpdatingTargetFile }},
  477.         CheckFileContainsRsrcByID { 10000, 'CODE', 2 },
  478.         AddAssertion {{ kUpdating68Kpart }}
  479.     }};
  480. };
  481.  
  482. // if PowerMac version exists, set assertion kUpdatingPowerMacPart
  483. resource 'inrl' (703, "Check if PowerMac version already exists") {
  484.     format0 {{
  485.         CheckAllAssertions {{ kUpdatingTargetFile }},
  486.         CheckFileContainsRsrcByID { 10000, 'cfrg', 0 },
  487.         AddAssertion {{ kUpdatingPowerMacPart }}
  488.     }};
  489. };
  490.  
  491. // if target volume is internal drive, set assertion kTgtVolIsInternalDrive
  492. resource 'inrl' (704, "Check if installing to internal volume") {
  493.     format0 {{
  494.         checkRuleFunction { kCheckIfInternalDriveUFID },
  495.         AddAssertion {{ kTgtVolIsInternalDrive }}
  496.     }};
  497. };
  498.  
  499. // if target volume is external drive, set assertion kTgtVolIsExternalDrive
  500. resource 'inrl' (705, "Check if installing to external volume") {
  501.     format0 {{
  502.         CheckAnyNonAssertion {{ kTgtVolIsInternalDrive }},
  503.         AddAssertion {{ kTgtVolIsExternalDrive }}
  504.     }};
  505. };
  506.  
  507.  
  508. // if machine is a PowerPC, set assertion kMachineIsPowerPC
  509. resource 'inrl' (706, "Check if machine is PowerPC") {
  510.     format0 {{
  511.         checkGestalt {gestaltSystemType, { gestaltPPCsysa } },
  512.         AddAssertion {{ kMachineIsPowerPC }}
  513.     }};
  514. };
  515.  
  516.  
  517. // • Easy Install framework
  518.  
  519. resource 'infr' (kEasyInstallFrameworkRsrcID) {
  520.     format0  {{
  521.         // pick the first true rule clause and
  522.         // add the appropriate package to Easy Install
  523.         pickFirst,    { 800, 801, 802, 803, 804, 805, 806, 807 },
  524.         }};
  525.     };
  526.  
  527. // if target file exists already, and
  528. // target file supports 68K and PowerMac,
  529. // add 68K and PowerMac packages and description to Easy Install
  530. // • this option is for updating an existing target application
  531. resource 'inrl' (800, "Check if updating FAT") {
  532.     format0 {{
  533.         CheckAllAssertions {{ kUpdating68Kpart, kUpdatingPowerMacPart }},
  534.         addUserDescription {"Click Install button to install\n" },
  535.         addUserDescription {"  • Demo Application for Any Macintosh\n"},
  536.         addPackages {{ kUpdateFullFatApp }}
  537.         }};
  538.     };
  539.  
  540. // if target file exists already, and
  541. // target file supports 68K but NOT Native Mode, and
  542. // target system is a PowerMac,
  543. // add 68K and PowerMac packages and description to Easy Install
  544. // • this option is for updating an existing target application
  545. resource 'inrl' (801, "Check if updating 68K version to a PowerMac") {
  546.     format0 {{
  547.         CheckAllAssertions {{ kUpdating68Kpart, kMachineIsPowerPC }},
  548.         addUserDescription {"Click Install button to install\n" },
  549.         addUserDescription {"  • Demo Application for Any Macintosh\n"},
  550.         addPackages {{ kUpdateFullFatApp }}
  551.         }};
  552.     };
  553.  
  554. // if target file exists already, and
  555. // target file supports Native Mode but NOT 68K, and
  556. // target system is a 68K,
  557. // add 68K and PowerMac packages and description to Easy Install
  558. // • this option is for updating an existing target application
  559. resource 'inrl' (802, "Check if updating PowerMac version to a 68K") {
  560.     format0 {{
  561.         CheckAllAssertions {{ kUpdatingPowerMacPart }},
  562.         CheckAllNonAssertions {{ kMachineIsPowerPC }},
  563.         addUserDescription {"Click Install button to install\n" },
  564.         addUserDescription {"  • Demo Application for Any Macintosh\n" },
  565.         addPackages {{ kUpdateFullFatApp }}
  566.         }};
  567.     };
  568.  
  569. // if target file exists already, and
  570. // installation is being performed to an external drive,
  571. // add 68K and PowerMac packages and description to Easy Install
  572. // • this option is for updating an existing target application
  573. resource 'inrl' (803, "Check if installing to an external drive") {
  574.     format0 {{
  575.         CheckAllAssertions {{ kUpdatingTargetFile }},
  576.         CheckAllAssertions {{ kTgtVolIsExternalDrive }},
  577.         addUserDescription {"Click Install button to install\n" },
  578.         addUserDescription {"  • Demo Application for Any Macintosh\n" },
  579.         addPackages {{ kUpdateFullFatApp }}
  580.         }};
  581.     };
  582.  
  583. // if target file does not exist already, and
  584. // installation is being performed to an external drive,
  585. // add 68K and PowerMac packages and description to Easy Install
  586. resource 'inrl' (804, "Check if installing to an external drive") {
  587.     format0 {{
  588.         CheckAllAssertions {{ kTgtVolIsExternalDrive }},
  589.         addUserDescription {"Click Install button to install\n" },
  590.         addUserDescription {"  • Demo Application for Any Macintosh\n" },
  591.         addPackages {{ kInstallFullFatApp }}
  592.         }};
  593.     };
  594.  
  595. // if target machine is a 68K,
  596. // add full 68K application package and description to Easy Install
  597. resource 'inrl' (805, "Check if installing to a 68K machine") {
  598.     format0 {{
  599.         CheckAllNonAssertions {{ kMachineIsPowerPC }},
  600.         addUserDescription {"Click Install button to install\n" },
  601.         addUserDescription {"  • Demo Application for your 68K Macintosh\n" },
  602.         addPackages {{ kOverWrite68KApp }}
  603.         }};
  604.     };
  605.  
  606. // if target machine is a PowerMac,
  607. // add full PowerMac application package and description to Easy Install
  608. resource 'inrl' (806, "Check if PowerMac machine") {
  609.     format0 {{
  610.         CheckAllAssertions {{ kMachineIsPowerPC }},
  611.         addUserDescription {"Click Install button to install\n" },
  612.         addUserDescription {"  • Demo Application for your Power Macintosh\n" },
  613.         addPackages {{ kUpdatePowerMacApp }}
  614.         }};
  615.     };
  616.  
  617. // if none of the other rule clauses in this set were satisfied
  618. // • this rule should never fire, but it's there just in case !!
  619. resource 'inrl' (807, "Otherwise handle as Fat App") {
  620.     format0 {{
  621.         ReportSysError {"Target System must be a 68K or PowerMac "
  622.                         "for installation."},
  623.         }};
  624.     };
  625.  
  626.  
  627. /******************* Custom Install Rule resources ***************************/
  628.  
  629. // • Custom Install framework
  630.  
  631. resource 'infr' (kCustomInstallFrameworkRsrcID) {
  632.     format0  {{
  633.         // pick the first true rule clause and
  634.         // add the appropriate package to Custom Install
  635.         pickFirst,    { 901, 902 },
  636.     }};
  637. };
  638.  
  639. // add package with all items to Custom Install for existing target app
  640. resource 'inrl' (901, "Add Custom Selection for Existing Target Application") {
  641.     format0 {{
  642.  
  643.         // only do this rule if target app already exists
  644.         CheckAllAssertions {{ kUpdatingTargetFile }},
  645.         
  646.         // contains all three choices for installing app from Custom Install
  647.         // but uses resource atoms ( 'inra' ) to handle installation of the
  648.         // "PowerMac Warning on 68K" CODE resource items ( see intro for info )
  649.         addCustomItems {{ kUpdateFullFatApp }}    
  650.         
  651.         }};
  652.     };
  653.  
  654. // add package with all items to Custom Install for new target app
  655. resource 'inrl' (902, "Add Custom Selection for New Target Application") {
  656.     format0 {{
  657.  
  658.         // contains all three choices for installing app from Custom Install
  659.         // but uses ResMerge atoms ( 'inrm' ) to handle installation of the
  660.         // "PowerMac Warning on 68K" CODE resource items ( see intro for info )
  661.         addCustomItems {{ kInstallFullFatApp }}    
  662.         
  663.         }};
  664.     };
  665.  
  666. /********************* Packages resources *****************************/
  667.  
  668. // Package for Demo App as fat app
  669. // this option is to be used when the target application is already present
  670. // • this package is one of the two main Custom Install packages
  671. resource 'inpk' ( kUpdateFullFatApp ) {
  672.     format0 {
  673.         showsOnCustom, removable, dontForceRestart,
  674.         kUpdateFullFatApp, 0, "Demo Application for Any Macintosh ( update )",
  675.             {
  676.             //  Delete entire file ( Custom Removal only )
  677.             'inpk', kDeleteFullApp,            
  678.  
  679.             //  68K part ( always overwrite )
  680.             'inpk', kOverWrite68KApp,        
  681.             
  682.             //  PowerMac part ( always overwrite )
  683.             'inpk', kUpdatePowerMacApp,    
  684.             
  685.             // NOTE: although the packages for 68K and PowerMac
  686.             // both include the common resources package, the
  687.             // common resources package will only be added once
  688.             // to the list of packages to be installed.
  689.             }
  690.         }
  691.     };
  692.  
  693. // Package for Demo App as fat app
  694. // this option is to be used when the target application is not already present
  695. // • this package is one of the two main Custom Install packages
  696. resource 'inpk' ( kInstallFullFatApp ) {
  697.     format0 {
  698.         showsOnCustom, removable, dontForceRestart,
  699.         kInstallFullFatApp, 0, "Demo Application for Any Macintosh ( install )",
  700.             {
  701.             //  Delete entire file ( Custom Removal only )
  702.             'inpk', kDeleteFullApp,            
  703.  
  704.             //  68K part ( always overwrite )
  705.             'inpk', kOverWrite68KApp,        
  706.             
  707.             //  PowerMac part ( always overwrite )
  708.             'inpk', kInstallPowerMacApp,    
  709.             
  710.             // NOTE: although the packages for 68K and PowerMac
  711.             // both include the common resources package, the
  712.             // common resources package will only be added once
  713.             // to the list of packages to be installed.
  714.             }
  715.         }
  716.     };
  717.  
  718. // Package for Demo App for 68K only via resource atoms
  719. resource 'inpk' ( kOverWrite68KApp ) {
  720.     format0 {
  721.         showsOnCustom, notRemovable, dontForceRestart,
  722.         kOverWrite68KApp, 0, "Demo Application for 68K Macintosh",
  723.             {    
  724.             // Common Resource fork ( always overwrite )
  725.             'inpk', kCommonStuff,    
  726.             
  727.             // 68K Macintosh CODE Resources
  728.             // this option utilizes 'inra' atoms that will always
  729.             // overwrite the target resource items 
  730.             'inpk', k68KStuff,    
  731.             }
  732.         }
  733.     };
  734.  
  735. // Package to Update Demo App for PowerMac
  736. // this option is to be used when the target application is already present
  737. resource 'inpk' ( kUpdatePowerMacApp ) {
  738.     format0 {
  739.         showsOnCustom, notRemovable, dontForceRestart,
  740.         kUpdatePowerMacApp, 0, "Demo Application for Power Macintosh",
  741.             {    
  742.             // Common resources    ( always overwrite )
  743.             'inpk', kCommonStuff,    
  744.  
  745.             // PowerMac Data Fork and resources ( always overwrite )
  746.             'inpk', kPowerMacStuff,    
  747.             
  748.             // PowerMac warning when launched on 68K ( never overwrite )
  749.             'inpk', kUpdatePowMacWarnOn68K,    
  750.             // has to be inra so it doesn't overwrite existing stuff
  751.                             
  752.             }
  753.         }
  754.     };
  755.  
  756. // Package to Install Demo App for PowerMac
  757. // this option is to be used when the target application is not already present
  758. resource 'inpk' ( kInstallPowerMacApp ) {
  759.     format0 {
  760.         showsOnCustom, notRemovable, dontForceRestart,
  761.         kUpdatePowerMacApp, 0, "Demo Application for Power Macintosh",
  762.             {    
  763.             // Common resources    ( always overwrite )
  764.             'inpk', kCommonStuff,    
  765.  
  766.             // PowerMac Data Fork and resources ( always overwrite )
  767.             'inpk', kPowerMacStuff,    
  768.             
  769.             // PowerMac warning when launched on 68K ( never overwrite )
  770.             // has to be inrm so it goes first, at this point we don't know
  771.             // whether both the PowerMac and 68K versions will be installed
  772.             // or if only the PowerMac version is going to be installed. This
  773.             // comes from the design specification that both the 68K and PowerMac
  774.             // only versions will be presented as subpackages of the Fat App
  775.             // under Custom Install. 
  776.             'inpk', kInstallPowMacWarnOn68K,    
  777.             }
  778.         }
  779.     };
  780.  
  781. // Package to add PowerMac version to 68K version
  782. resource 'inpk' ( kAddPowerMacTo68KApp ) {
  783.     format0 {
  784.         doesntShowOnCustom, removable, dontForceRestart,
  785.         0, 0, "Package to add PowerMac support to 68K application",
  786.             {    
  787.             // Common resources    ( always overwrite )
  788.             'inpk', kCommonStuff,    
  789.  
  790.             // PowerMac Data Fork and resources ( always overwrite )
  791.             'inpk', kPowerMacStuff,
  792.             }
  793.         }
  794.     };
  795.  
  796. // Sub-Package to DELETE entire app, whether 68K or PowerMac
  797. resource 'inpk' ( kDeleteFullApp ) {
  798.     format0 {
  799.         doesntShowOnCustom, removable, dontForceRestart,
  800.         0, 0, "Package to delete the demo app",
  801.             {    
  802.             // Delete entire file on Custom Removal
  803.             'infa', kDeleteFullApp,        
  804.             }
  805.         }
  806.     };
  807.  
  808. // Sub-Package of Common Resources
  809. resource 'inpk' ( kCommonStuff ) {
  810.     format0 {
  811.         doesntShowOnCustom, notRemovable, dontForceRestart,
  812.         0, 0, "Sub-Package of Common Resources",
  813.             {    
  814.             //  Common Resources ( always overwrite )
  815.             'inrm', kCommonStuff,    
  816.             }
  817.         }
  818.     };
  819.  
  820. // Sub-Package of 68K specific resources
  821. resource 'inpk' ( k68KStuff ) {
  822.     format0 {
  823.         doesntShowOnCustom, notRemovable, dontForceRestart,
  824.         0, 0, "Package for 68K Macintosh",
  825.             {    
  826.             // 68K Macintosh CODE Resources ( always overwrite )
  827.             'inra', 500,    
  828.             'inra', 501,    
  829.             'inra', 502    
  830.             }
  831.         }
  832.     };
  833.  
  834. // Sub-Package of PowerMac warning when launched on 68K
  835. // • this option is to be used when the target application is not already present
  836. resource 'inpk' ( kInstallPowMacWarnOn68K ) {
  837.     format0 {
  838.         doesntShowOnCustom, notRemovable, dontForceRestart,
  839.         0, 0, "Package for Power Macintosh warning on 68K",
  840.             {    
  841.             'inrm', 400,    // PowerMac Warning stuff
  842.             }
  843.         }
  844.     };
  845.  
  846. // Sub-Package of PowerMac warning when launched on 68K
  847. // • this option is to be used when the target application is already present
  848. resource 'inpk' ( kUpdatePowMacWarnOn68K ) {
  849.     format0 {
  850.         doesntShowOnCustom, notRemovable, dontForceRestart,
  851.         0, 0, "Package for Power Macintosh warning on 68K",
  852.             {    
  853.             'inra', 600,    // PowerMac Warning stuff
  854.             'inra', 601,    // PowerMac Warning stuff
  855.             'inra', 602,    // PowerMac Warning stuff
  856.             'inra', 603,    // PowerMac Warning stuff
  857.             'inra', 604,    // PowerMac Warning stuff
  858.             }
  859.         }
  860.     };
  861.  
  862. // Sub-Package of PowerMac data fork and PowerMac specific resources
  863. resource 'inpk' ( kPowerMacStuff ) {
  864.     format0 {
  865.         doesntShowOnCustom, notRemovable, dontForceRestart,
  866.         0, 0, "Package for Power Macintosh",
  867.             {    
  868.             // Power Macintosh Data Fork ( always overwrite )
  869.             'infa', kPowerMacFileAtom,    
  870.             
  871.             // 'cfrg' resource detailing contents of code in data fork
  872.             'inra', kPowerMacRsrcAtom,
  873.             
  874.             // NOTE: Because we have chosen to specify that the resource
  875.             // fork will not be replaced when installing the kPowerMacStuff
  876.             // file atom ( by setting 'noRsrcFork' in the atom ) we must
  877.             // install the one resource item for 'cfrg' with a seperate
  878.             // resource atom.
  879.             }
  880.         }
  881.     };
  882.  
  883.  
  884. // package comment for Fat application ( pre-4.0 package comments )
  885. resource 'icmt' ( kUpdateFullFatApp ) {
  886.     currentReleaseDate, currentVersion, 30000,
  887.     "This contains the Demo Application, which can be run on any Macintosh."
  888.     };
  889.  
  890. // package comment for Fat application ( pre-4.0 package comments )
  891. resource 'icmt' ( kInstallFullFatApp ) {
  892.     currentReleaseDate, currentVersion, 30000,
  893.     "This contains the Demo Application, which can be run on any Macintosh."
  894.     };
  895.  
  896. // package comment for 68K application ( pre-4.0 package comments )
  897. resource 'icmt' ( kOverWrite68KApp ) {
  898.     currentReleaseDate, currentVersion, 30000,
  899.     "This contains the Demo Application for use on 68K Macintosh."
  900.     };
  901.  
  902. // package comment for PowerMac application ( pre-4.0 package comments )
  903. resource 'icmt' ( kUpdatePowerMacApp ) {
  904.     currentReleaseDate, currentVersion, 30000,
  905.     "This contains the Demo Application for use on Power Macintosh."
  906.     };
  907.  
  908. // just a good old application icon
  909. // to be included in the package comment resources above
  910. data 'ICON' (30000) {
  911.     $"0001 0000 0002 8000 0004 4000 0008 2000"
  912.     $"0010 1000 0020 0800 0040 0400 0080 0200"
  913.     $"0100 0100 0200 0080 0400 0040 0800 0020"
  914.     $"1000 0010 2000 0008 4000 3F04 8000 4082"
  915.     $"4000 8041 2001 3022 1001 C814 080E 7F8F"
  916.     $"0402 3007 0201 0007 0100 8007 0080 6007"
  917.     $"0040 1FE7 0020 021F 0010 0407 0008 0800"
  918.     $"0004 1000 0002 2000 0001 4000 0000 8000"
  919.     };
  920.  
  921.  
  922. /************************** Atoms resources **********************************/
  923.  
  924.  
  925. // ResMerge Atom to install common resources
  926. resource 'inrm' ( kCommonStuff ) {
  927.     format0 {
  928.         0,                // Total size of resources
  929.                         // ( filled in by ScriptCheck if 0 )
  930.                         
  931.         10000,            // Target File Spec
  932.         
  933.         20001,            // Source File Spec 
  934.                         // Demo App Parts:Common Part
  935.                         
  936.         "Installing Common Resources"
  937.     }
  938. };
  939.  
  940. // ResMerge Atom to install 68K CODE resources
  941. resource 'inrm' ( k68KStuff ) {
  942.     format0 {
  943.         0,                // Total size of resources
  944.                         // ( filled in by ScriptCheck if 0 )
  945.                         
  946.         10000,            // Target File Spec
  947.         
  948.         20004,            // Source File Spec
  949.                         // Demo App Parts:68K Part
  950.         ""
  951.     }
  952. };
  953.  
  954. // "PowerMac Warn on 68K" resource items
  955. resource 'inrm' (400) {
  956.     format0 {
  957.         0,                // Total size of resources
  958.                         // ( filled in by ScriptCheck if 0 )
  959.                         
  960.         10000,            // Target File Spec
  961.         
  962.         20004,            // Source File Spec 
  963.                         // Demo App Parts:PowerMacWarnOn68K Part
  964.                         
  965.         ""
  966.     }
  967. };
  968.  
  969. // This File Atom deletes the entire file on removals
  970. resource 'infa' ( kDeleteFullApp ) {
  971.     format1 {
  972.         deleteWhenRemoving,                // make sure atom is included on removal
  973.         dontDeleteWhenInstalling,        // ignore atom during installs
  974.         dontCopy,                        // ignore atom during installs
  975.         dontIgnoreLockedFile,            // don't remove a locked file
  976.         
  977.         dontSetFileLocked,                // ignored during removals
  978.         useSrcCrDateToCompare,            // ignored during removals
  979.         srcNeedExist,                    // ignored during removals
  980.         rsrcForkInRsrcFork,
  981.         leaveAloneIfNewer,                // ignored during removals
  982.         updateExisting,                 // ignored during removals
  983.         copyIfNewOrUpdate,                // ignored during removals
  984.         
  985.         rsrcFork,                        // remove resource fork
  986.         dataFork,                        // remove data fork
  987.         0,
  988.         0,
  989.         10000,                            // target spec for removal
  990.         {    0, 0, 0    },                    // no source spec needed for removal
  991.         0x0,
  992.         0,
  993.         0,
  994.         ""
  995.     }
  996. };
  997.  
  998.  
  999.  
  1000. // Installs PowerMac Native Mode RISC code contained in data fork
  1001. // NOTE: this does NOT overwrite existing resource fork !!
  1002. // • uses InstaCompOne decompression from file archive
  1003. resource 'infa' ( kPowerMacFileAtom ) {
  1004.     format1 {
  1005.         dontDeleteWhenRemoving,
  1006.         dontDeleteWhenInstalling,
  1007.         copy,
  1008.         dontIgnoreLockedFile,
  1009.         dontSetFileLocked,
  1010.         useVersProcToCompare,    
  1011.         srcNeedExist,
  1012.         rsrcForkInDataFork,                // InstaCompOne file compression
  1013.                                         // always put rsrc's in data fork
  1014.         leaveAloneIfNewer,
  1015.         updateExisting,
  1016.         copyIfNewOrUpdate,
  1017.         
  1018.         noRsrcFork,                        // because this flag is set
  1019.                                         // to 'noRsrcFork' this atom
  1020.                                         // will not disturb resource
  1021.                                         // fork of target file
  1022.         dataFork,
  1023.         0,                                
  1024.         
  1025.         0x2000+0x0040,                    // finder attribute flags - when copying
  1026.                                         // a bona fide file, ScriptCheck can set
  1027.                                         // this value. But since we copying
  1028.                                         // the data fork from a file that is not
  1029.                                         // the original application, we must set
  1030.                                         // these Finder attributes manually
  1031.                                         
  1032.         10000,                            // target spec for install
  1033.         {    20005,                         // source spec for install
  1034.             0, 
  1035.             0    
  1036.         },
  1037.         0x01008000,                        // version number 1.0
  1038.         
  1039.                                         // WARNING: It is probably best
  1040.                                         // to include a 'vers' resource
  1041.                                         // of ID (1) or (2) in the archive
  1042.                                         // file containing the data fork
  1043.                                         // for PowerMac so that version 
  1044.                                         // comparison to existing file will
  1045.                                         // be performed correctly. A non-zero
  1046.                                         // value for the version field should
  1047.                                         // not be updated by ScriptCheck, but
  1048.                                         // ScriptCheck 4.0.3 seems to update
  1049.                                         // this field no matter what. Use the
  1050.                                         // 'vers' resource from the Common Part
  1051.                                         // and paste it into the file archive.
  1052.         0,                                
  1053.         241,                            // InstaCompOne atom extender ID                                
  1054.         
  1055.         ""                                // atom description
  1056.     }
  1057. };
  1058.  
  1059.  
  1060. // PowerMac 'cfrg' resource item
  1061. resource 'inra' ( kPowerMacRsrcAtom ) {
  1062.     format1 {
  1063.         dontDeleteWhenRemoving,
  1064.         dontDeleteWhenInstalling,
  1065.         copy,
  1066.         leaveAloneIfNewer,
  1067.         noTgtRequired,
  1068.         updateExisting,
  1069.         copyIfNewOrUpdate,
  1070.         ignoreProtection,
  1071.         srcNeedExist,
  1072.         byID,
  1073.         nameNeedNotMatch,
  1074.         0,
  1075.         10000,
  1076.         'cfrg',
  1077.         0,
  1078.         0x0,
  1079.         "",
  1080.         {    20003, 'cfrg', 0, 0, ""    },
  1081.         0x0,
  1082.         0,
  1083.         0,
  1084.         ""
  1085.         }
  1086.     };
  1087.  
  1088. // "PowerMac Warn on 68K" resource item
  1089. resource 'inra' (600) {
  1090.     format1 {
  1091.         dontDeleteWhenRemoving,
  1092.         dontDeleteWhenInstalling,
  1093.         copy,
  1094.         leaveAloneIfNewer,
  1095.         noTgtRequired,
  1096.         keepExisting,
  1097.         copyIfNewOrUpdate,
  1098.         ignoreProtection,
  1099.         srcNeedExist,
  1100.         byID,
  1101.         nameNeedNotMatch,
  1102.         0,
  1103.         10000,
  1104.         'CODE',
  1105.         0,
  1106.         0x0,
  1107.         "",
  1108.         {    20004, 'CODE', 0, 0, ""    },
  1109.         0x0,
  1110.         0,
  1111.         0,
  1112.         ""
  1113.         }
  1114.     };
  1115.  
  1116. // "PowerMac Warn on 68K" resource item
  1117. resource 'inra' (601) {
  1118.     format1 {
  1119.         dontDeleteWhenRemoving,
  1120.         dontDeleteWhenInstalling,
  1121.         copy,
  1122.         leaveAloneIfNewer,
  1123.         noTgtRequired,
  1124.         keepExisting,
  1125.         copyIfNewOrUpdate,
  1126.         ignoreProtection,
  1127.         srcNeedExist,
  1128.         byID,
  1129.         nameNeedNotMatch,
  1130.         0,
  1131.         10000,
  1132.         'CODE',
  1133.         1,
  1134.         0x0,
  1135.         "",
  1136.         {    20004, 'CODE', 1, 0, ""    },
  1137.         0x0,
  1138.         0,
  1139.         0,
  1140.         ""
  1141.         }
  1142.     };
  1143.  
  1144. // "PowerMac Warn on 68K" resource item
  1145. resource 'inra' (602) {
  1146.     format1 {
  1147.         dontDeleteWhenRemoving,
  1148.         dontDeleteWhenInstalling,
  1149.         copy,
  1150.         leaveAloneIfNewer,
  1151.         noTgtRequired,
  1152.         keepExisting,
  1153.         copyIfNewOrUpdate,
  1154.         ignoreProtection,
  1155.         srcNeedExist,
  1156.         byID,
  1157.         nameNeedNotMatch,
  1158.         0,
  1159.         10000,
  1160.         'ALRT',
  1161.         27309,
  1162.         0x0,
  1163.         "",
  1164.         {    20004, 'ALRT', 27309, 0, ""    },
  1165.         0x0,
  1166.         0,
  1167.         0,
  1168.         ""
  1169.         }
  1170.     };
  1171.  
  1172. // "PowerMac Warn on 68K" resource item
  1173. resource 'inra' (603) {
  1174.     format1 {
  1175.         dontDeleteWhenRemoving,
  1176.         dontDeleteWhenInstalling,
  1177.         copy,
  1178.         leaveAloneIfNewer,
  1179.         noTgtRequired,
  1180.         keepExisting,
  1181.         copyIfNewOrUpdate,
  1182.         ignoreProtection,
  1183.         srcNeedExist,
  1184.         byID,
  1185.         nameNeedNotMatch,
  1186.         0,
  1187.         10000,
  1188.         'DITL',
  1189.         27309,
  1190.         0x0,
  1191.         "",
  1192.         {    20004, 'DITL', 27309, 0, ""    },
  1193.         0x0,
  1194.         0,
  1195.         0,
  1196.         ""
  1197.         }
  1198.     };
  1199.  
  1200. // "PowerMac Warn on 68K" resource item
  1201. resource 'inra' (604) {
  1202.     format1 {
  1203.         dontDeleteWhenRemoving,
  1204.         dontDeleteWhenInstalling,
  1205.         copy,
  1206.         leaveAloneIfNewer,
  1207.         noTgtRequired,
  1208.         keepExisting,
  1209.         copyIfNewOrUpdate,
  1210.         ignoreProtection,
  1211.         srcNeedExist,
  1212.         byID,
  1213.         nameNeedNotMatch,
  1214.         0,
  1215.         10000,
  1216.         'STR ',
  1217.         27309,
  1218.         0x0,
  1219.         "",
  1220.         {    20004, 'STR ', 27309, 0, ""    },
  1221.         0x0,
  1222.         0,
  1223.         0,
  1224.         ""
  1225.         }
  1226.     };
  1227.  
  1228. // 68K CODE resource item
  1229. resource 'inra' (500) {
  1230.     format1 {
  1231.         dontDeleteWhenRemoving,
  1232.         deleteWhenInstalling,
  1233.         copy,
  1234.         leaveAloneIfNewer,
  1235.         noTgtRequired,
  1236.         updateExisting,
  1237.         copyIfNewOrUpdate,
  1238.         ignoreProtection,
  1239.         srcNeedExist,
  1240.         byID,
  1241.         nameNeedNotMatch,
  1242.         0,
  1243.         10000,
  1244.         'CODE',
  1245.         0,
  1246.         0x0,
  1247.         "",
  1248.         {    20002, 'part', 0, 0, ""    },
  1249.         0x0,
  1250.         0,
  1251.         241,
  1252.         ""
  1253.         }
  1254.     };
  1255.  
  1256. // 68K CODE resource item
  1257. resource 'inra' (501) {
  1258.     format1 {
  1259.         dontDeleteWhenRemoving,
  1260.         deleteWhenInstalling,
  1261.         copy,
  1262.         leaveAloneIfNewer,
  1263.         noTgtRequired,
  1264.         updateExisting,
  1265.         copyIfNewOrUpdate,
  1266.         ignoreProtection,
  1267.         srcNeedExist,
  1268.         byID,
  1269.         nameNeedNotMatch,
  1270.         0,
  1271.         10000,
  1272.         'CODE',
  1273.         1,
  1274.         0x0,
  1275.         "",
  1276.         {    20002, 'part', 1, 0, ""    },
  1277.         0x0,
  1278.         0,
  1279.         241,
  1280.         ""
  1281.         }
  1282.     };
  1283.  
  1284. // 68K CODE resource item
  1285. resource 'inra' (502) {
  1286.     format1 {
  1287.         dontDeleteWhenRemoving,
  1288.         deleteWhenInstalling,
  1289.         copy,
  1290.         leaveAloneIfNewer,
  1291.         noTgtRequired,
  1292.         updateExisting,
  1293.         copyIfNewOrUpdate,
  1294.         ignoreProtection,
  1295.         srcNeedExist,
  1296.         byID,
  1297.         nameNeedNotMatch,
  1298.         0,
  1299.         10000,
  1300.         'CODE',
  1301.         2,
  1302.         0x0,
  1303.         "",
  1304.         {    20002, 'part', 2, 0, ""    },
  1305.         0x0,
  1306.         0,
  1307.         241,
  1308.         ""
  1309.         }
  1310.     };
  1311.  
  1312.  
  1313. /********************* Target File Spec. resources *****************************/
  1314.  
  1315. // target spec for all the various incarnations of application
  1316. resource 'intf' (10000) {
  1317.     format1 {
  1318.         noSearchForFile,                     // use default search path
  1319.         TypeCrNeedNotMatch,                 // target TYPE,CREATOR need not match
  1320.         'APPL',                             // target TYPE ( ignored, see above )
  1321.         'moda',                             // target CREATOR ( ignored, see above )
  1322.         0x2000+0x0040,                         // finder attribute flags
  1323.         1,                                      // creation date for new file
  1324.         1,                                      // modification date for new file
  1325.         0,                                     // search proc ID ( 'insp' )
  1326.         
  1327.         "folder-user:ModApp"                 // path to target file
  1328.                                             // NOTE: The filename contained
  1329.                                             // in the path to target file is
  1330.                                             // used as the filename to extract
  1331.                                             // from an archive when InstaCompOne
  1332.                                             // is called from within a file atom
  1333.                                             // and this 'intf' is used. This same
  1334.                                             // filename must be used when compressing 
  1335.                                             // the file into the archive ( makefile ).
  1336.         }
  1337.     };
  1338.  
  1339.  
  1340. /********************* Source File Spec. resources *****************************/
  1341.  
  1342. resource 'infs' (20001) {
  1343.     'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
  1344.     "Disk 1:Common Part"
  1345.     };
  1346.  
  1347. // NOTE: The type for resource archives is 'ircp' ( installer resource compression )
  1348. resource 'infs' (20002) {
  1349.     'ircp', 'kakc', 0x1, noSearchForFile, TypeCrMustMatch,
  1350.     "Disk 1:68KRsrcArchive"
  1351.     };
  1352.  
  1353. resource 'infs' (20003) {
  1354.     'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
  1355.     "Disk 1:Power Macintosh Part"
  1356.     };
  1357.  
  1358. // NOTE: The type for file archives is 'idcp' ( installer data compression )
  1359. resource 'infs' (20005) {
  1360.     'idcp', 'kakc', 0x1, noSearchForFile, TypeCrMustMatch,
  1361.     "Disk 1:PowMacFileArchive"
  1362.     };
  1363.  
  1364. resource 'infs' (20004) {
  1365.     'rsrc', 'RSED', 0x1, noSearchForFile, TypeCrMustMatch,
  1366.     "Disk 1:PowerMacWarnOn68K Part"
  1367.     };
  1368.  
  1369.  
  1370.  
  1371. resource 'inrf' (kCheckIfInternalDriveUFID) {
  1372.     format0 {
  1373.         userFunctionType,        // code resource type
  1374.         143,                    // code resource ID
  1375.         0,                        // refCon 
  1376.         
  1377.         0,                        // use installer's heap, 
  1378.                                 // instead of a seperate subheap
  1379.         
  1380.         "This Rule Function returns TRUE if the target volume has SCSI ID = 0."
  1381.         }
  1382.     };
  1383.  
  1384. //     The preference resource allows that script writer to specify 
  1385. //    certain attributes of the Installer's interface and actions.  
  1386. //    This resource is the default if the script writer does not provide one.
  1387. resource 'inpr' (300) {
  1388.     format0 {
  1389.         useFolderTargetMode,            // allow user to select target folder
  1390.         dontAllowUserToSetSystemDisk,    // we're not installing to system folder
  1391.         showSelectedSizeInCustom,
  1392.         noSetupFunctionSupplied,
  1393.         dontAllowCleanInstall,
  1394.         dontAllowServerAsTarget,
  1395.         0,
  1396.         0,
  1397.             {    
  1398.             301, 311, 301, 311,
  1399.             302, 312, 302, 312
  1400.             },
  1401.         "Demo Application Folder"
  1402.         }
  1403.     };
  1404.  
  1405.  
  1406.  
  1407.